# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-play-scraper
pkgname=('python2-play-scraper' 'python-play-scraper')
_pkgname=play_scraper
pkgver=0.6.0
pkgrel=7
pkgdesc='Google Play Store application scraper.'
arch=('any')
url='https://pypi.org/project/play-scraper/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/play_scraper-$pkgver.tar.gz")
sha512sums=('7a2ab229f03ec598770d9caffda103a5f3d37d2aa096bca60a04eadf0e1da569a0c988ef6edba3502449db5d441f6f163b525b98a70c74adcd570abb7fe34db2')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-play-scraper() {
  depends=('python2' 'python2-beautifulsoup4' 'python2-lxml'
           'python2-requests-futures')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-play-scraper() {
  depends=('python' 'python-beautifulsoup4' 'python-lxml'
           'python-requests-futures')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

